feat: add the resolvers for gymnasts, their lists and routines #79
+1,581
−72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
A logged-in coach can keep gymnasts, their lists of elements and their routines through the API. Closes #73.
Stacked. The base is
70-session-tokens(#82, the session), which is on #78 (codegen), #77 (calculator) and #65 (server). This branch also contains a merge of the branch of #49 (the schema fields it needs), so until #49 is merged intodevthe diff of this PR includes #49's changes. Change the base todevwhen the others are merged. It does not depend on the Google login (#71, draft): it only needs to know who is asking, which the access token from #82 gives.What's in it
NOT_FOUNDwith the same message as an unknown id, and nothing changes (tested for all ten operations).NOT_FOUND. Removed item: cannot be added (INVALID_ITEMS), can be taken out. At most 100.NAME_TAKENper gymnast and apparatus, at most 50 per gymnast.setRoutineItems: replaces the list in one transaction and setsupdatedAt. Items must be on the routine's apparatus, at most one vault on vault, a removed item may stay but not be added. The first statement of the transaction updates the routine row, which locks it, so two saves at the same moment follow each other (last one wins, tested). A failed save changes nothing.Routine.dScore: the calculator's function;nullwhile the routine has a removed item.NOT_FOUND,NAME_TAKEN,LIMIT_REACHED. ADateTimescalar (ISO 8601). The login resolvers moved toresolvers/auth.ts.docs/API.mdreplaces "What is not built yet"; README anddocs/AI_USAGE.mdupdated.Things to know
docs/API.md.include.Testing
tsc --noEmitand 192 tests pass against a database (0 skipped); 40 are new (userData.test.ts, with two test coaches that are deleted afterwards, and one element that is marked removed and restored).🤖 Generated with Claude Code